<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title></title>
</head>
<body>
	<ul>
		<li>1</li>
		<li>2</li>
		<li>3</li>
		<li>4</li>
		<li>5</li>
	</ul>
<script type="text/javascript">
	let ul = document.getElementsByTagName('ul')[0]
	//获取第一个子元素firstElementChild
	console.log(ul.firstElementChild)
	//不实用
	// console.log(ul.firstChild)

	//最后一个子元素 lastElementChild
	console.log(ul.lastElementChild)

	//获取所有子元素 children 返回伪数组
	console.log(ul.children[2])

	//不实用
	console.log(ul.childNodes)
</script>
</body>
</html>